<!DOCTYPE html>
<html lang="en">
  <head>
    <title>FolioReaderKit  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">
    <script src="js/jquery.min.js" defer></script>
    <script src="js/jazzy.js" defer></script>
    
    <script src="js/lunr.min.js" defer></script>
    <script src="js/typeahead.jquery.js" defer></script>
    <script src="js/jazzy.search.js" defer></script>
  </head>
  <body>


    <a title="FolioReaderKit  Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="index.html">
          FolioReaderKit Docs
        </a>
        
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/FolioReader/FolioReaderKit">
            <img class="header-icon" src="img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="dash-feed://https%3A%2F%2FfolioReader%2Egithub%2Eio%2FFolioReaderKit%2Fdocsets%2FFolioReaderKit%2Exml">
            <img class="header-icon" src="img/dash.png"/>
            Install in Dash
          </a>
        </p>
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="index.html">FolioReaderKit Reference</a>
      <img class="carat" src="img/carat.png" />
      FolioReaderKit  Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FRBook.html">FRBook</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FRResource.html">FRResource</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes.html#/c:@M@FolioReaderKit@objc(cs)FRResources">FRResources</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FRTocReference.html">FRTocReference</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReader.html">FolioReader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReaderAudioPlayer.html">FolioReaderAudioPlayer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReaderCenter.html">FolioReaderCenter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReaderConfig.html">FolioReaderConfig</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReaderContainer.html">FolioReaderContainer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReaderPage.html">FolioReaderPage</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/FolioReaderWebView.html">FolioReaderWebView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/Highlight.html">Highlight</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/Highlight.html#/s:14FolioReaderKit9HighlightC08MatchingD0V">– MatchingHighlight</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/FolioReaderError.html">FolioReaderError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/FolioReaderFont.html">FolioReaderFont</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/FolioReaderFontSize.html">FolioReaderFontSize</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/FolioReaderScrollDirection.html">FolioReaderScrollDirection</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/HighlightStyle.html">HighlightStyle</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/MediaOverlayStyle.html">MediaOverlayStyle</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Extensions/UIAlertController.html">UIAlertController</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/FolioReaderCenterDelegate.html">FolioReaderCenterDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/FolioReaderDelegate.html">FolioReaderDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/FolioReaderPageDelegate.html">FolioReaderPageDelegate</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ClassBasedOnClickListener.html">ClassBasedOnClickListener</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/MediaType.html">MediaType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/QuoteImage.html">QuoteImage</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            
            <p><img src="https://raw.githubusercontent.com/FolioReader/FolioReaderKit/assets/folioreader.png" alt="FolioReader logo">
FolioReaderKit is an ePub reader and parser framework for iOS written in Swift.</p>

<p><img src="https://img.shields.io/cocoapods/v/FolioReaderKit.svg" alt="Version">
<img src="https://img.shields.io/cocoapods/l/FolioReaderKit.svg" alt="License"></p>
<h2 id='features' class='heading'>Features</h2>

<ul>
<li>[x] ePub 2 and ePub 3 support</li>
<li>[x] Custom Fonts</li>
<li>[x] Custom Text Size</li>
<li>[x] Text Highlighting</li>
<li>[x] List / Edit / Delete Highlights</li>
<li>[x] Themes / Day mode / Night mode</li>
<li>[x] Handle Internal and External Links</li>
<li>[x] Portrait / Landscape</li>
<li>[x] Reading Time Left / Pages left</li>
<li>[x] In-App Dictionary</li>
<li>[x] Media Overlays (Sync text rendering with audio playback)</li>
<li>[x] TTS - Text to Speech Support</li>
<li>[x] Parse epub cover image</li>
<li>[x] RTL Support</li>
<li>[x] Vertical or/and Horizontal scrolling</li>
<li>[x] Share Custom Image Quotes <strong><sup>NEW</sup></strong></li>
<li>[x] Support multiple instances at same time, like parallel reading <strong><sup>NEW</sup></strong></li>
<li>[ ] Book Search</li>
<li>[ ] Add Notes to a Highlight</li>
</ul>
<h2 id='demo' class='heading'>Demo</h2>

<table><thead>
<tr>
<th style="text-align: center"><strong>Custom Fonts :smirk:</strong></th>
<th style="text-align: center"><strong>Text Highlighting :heart_eyes:</strong></th>
</tr>
</thead><tbody>
<tr>
<td style="text-align: center"><img src="https://raw.githubusercontent.com/FolioReader/FolioReaderKit/assets/custom-fonts.gif" alt="Custom fonts"></td>
<td style="text-align: center"><img src="https://raw.githubusercontent.com/FolioReader/FolioReaderKit/assets/highlight.gif" alt="Highlight"></td>
</tr>
</tbody></table>

<table><thead>
<tr>
<th style="text-align: center"><strong>Reading Time Left :open_mouth:</strong></th>
<th style="text-align: center"><strong>Media Overlays 😭</strong></th>
</tr>
</thead><tbody>
<tr>
<td style="text-align: center"><img src="https://raw.githubusercontent.com/FolioReader/FolioReaderKit/assets/time-left.mov.gif" alt="Time left"></td>
<td style="text-align: center"><img src="https://raw.githubusercontent.com/FolioReader/FolioReaderKit/assets/media-overlays.gif" alt="Media Overlays"></td>
</tr>
</tbody></table>
<h2 id='installation' class='heading'>Installation</h2>

<p><strong>FolioReaderKit</strong> is available through <a href="http://cocoapods.org">CocoaPods</a> and <a href="https://github.com/Carthage/Carthage">Carthage</a>. </p>
<h3 id='cocoapods' class='heading'>Cocoapods</h3>

<p><a href="http://cocoapods.org">CocoaPods</a> is a dependency manager for Cocoa projects. You can install it with the following command:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>gem install cocoapods
</code></pre>

<p>To integrate FolioReaderKit into your Xcode project using CocoaPods, specify it in your <code>Podfile</code>:</p>
<pre class="highlight ruby"><code><span class="n">source</span> <span class="s1">'https://github.com/CocoaPods/Specs.git'</span>
<span class="n">platform</span> <span class="ss">:ios</span><span class="p">,</span> <span class="s1">'9.0'</span>
<span class="n">use_frameworks!</span>

<span class="n">target</span> <span class="s1">'&lt;Your Target Name&gt;'</span> <span class="k">do</span>
    <span class="n">pod</span> <span class="s1">'FolioReaderKit'</span>
<span class="k">end</span>
</code></pre>

<p>Then, run the following command:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>pod install
</code></pre>

<p>Alternatively to give it a test run, run the command:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>pod try FolioReaderKit
</code></pre>
<h3 id='carthage' class='heading'>Carthage</h3>

<p>Add the following to your <a href="https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile">Cartfile</a></p>
<pre class="highlight ruby"><code><span class="n">github</span> <span class="s2">"FolioReader/FolioReaderKit"</span>
</code></pre>

<p>Run the following command:</p>
<pre class="highlight shell"><code><span class="gp">$ </span>carthage update --platform iOS --no-use-binaries
</code></pre>

<p>Then, follow the steps as described in Carthage&rsquo;s <a href="https://github.com/Carthage/Carthage#adding-frameworks-to-an-application">README</a>.</p>
<h2 id='requirements' class='heading'>Requirements</h2>

<ul>
<li>iOS 9.0+</li>
<li>Xcode 10.1+</li>
</ul>
<h2 id='basic-usage' class='heading'>Basic Usage</h2>

<p>To get started, this is a simple usage sample of using the integrated view controller.</p>
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">FolioReaderKit</span>

<span class="kd">func</span> <span class="nf">open</span><span class="p">(</span><span class="nv">sender</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">let</span> <span class="nv">config</span> <span class="o">=</span> <span class="kt">FolioReaderConfig</span><span class="p">()</span>
 <span class="err"> </span> <span class="err"> </span><span class="k">let</span> <span class="nv">bookPath</span> <span class="o">=</span> <span class="kt">Bundle</span><span class="o">.</span><span class="n">main</span><span class="o">.</span><span class="nf">path</span><span class="p">(</span><span class="nv">forResource</span><span class="p">:</span> <span class="s">"book"</span><span class="p">,</span> <span class="nv">ofType</span><span class="p">:</span> <span class="s">"epub"</span><span class="p">)</span>
    <span class="k">let</span> <span class="nv">folioReader</span> <span class="o">=</span> <span class="kt">FolioReader</span><span class="p">()</span>
 <span class="err"> </span> <span class="err"> </span><span class="n">folioReader</span><span class="o">.</span><span class="nf">presentReader</span><span class="p">(</span><span class="nv">parentViewController</span><span class="p">:</span> <span class="k">self</span><span class="p">,</span> <span class="nv">withEpubPath</span><span class="p">:</span> <span class="n">bookPath</span><span class="o">!</span><span class="p">,</span> <span class="nv">andConfig</span><span class="p">:</span> <span class="n">config</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>

<p>For more usage examples check the <a href="/Example">Example</a> folder.</p>
<h2 id='storyboard' class='heading'>Storyboard</h2>

<p>To get started, here is a simple example how to use the integrated view controller with storyboards.</p>
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">FolioReaderKit</span>

<span class="kd">class</span> <span class="kt">StoryboardFolioReaderContrainer</span><span class="p">:</span> <span class="kt">FolioReaderContainer</span> <span class="p">{</span>
    <span class="kd">required</span> <span class="nf">init</span><span class="p">?(</span><span class="n">coder</span> <span class="nv">aDecoder</span><span class="p">:</span> <span class="kt">NSCoder</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">super</span><span class="o">.</span><span class="nf">init</span><span class="p">(</span><span class="nv">coder</span><span class="p">:</span> <span class="n">aDecoder</span><span class="p">)</span>

        <span class="k">let</span> <span class="nv">config</span> <span class="o">=</span> <span class="kt">FolioReaderConfig</span><span class="p">()</span>
        <span class="n">config</span><span class="o">.</span><span class="n">scrollDirection</span> <span class="o">=</span> <span class="o">.</span><span class="n">horizontalWithVerticalContent</span>

        <span class="k">guard</span> <span class="k">let</span> <span class="nv">bookPath</span> <span class="o">=</span> <span class="kt">Bundle</span><span class="o">.</span><span class="n">main</span><span class="o">.</span><span class="nf">path</span><span class="p">(</span><span class="nv">forResource</span><span class="p">:</span> <span class="s">"The Silver Chair"</span><span class="p">,</span> <span class="nv">ofType</span><span class="p">:</span> <span class="s">"epub"</span><span class="p">)</span> <span class="k">else</span> <span class="p">{</span> <span class="k">return</span> <span class="p">}</span>
        <span class="nf">setupConfig</span><span class="p">(</span><span class="n">config</span><span class="p">,</span> <span class="nv">epubPath</span><span class="p">:</span> <span class="n">bookPath</span><span class="p">)</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre>

<p>Go to your storyboard file, choose or create the view controller that should present the epub reader. In the identity inspector set StoryboardFolioReaderContrainer as class.</p>
<h2 id='documentation' class='heading'>Documentation</h2>

<p>Checkout <a href="/Example">Example</a> and <a href="https://folioReader.github.io/FolioReaderKit/">API Documentation</a></p>

<p>You can always use the header-doc. (use <strong>alt+click</strong> in Xcode)</p>

<p><img src="https://raw.githubusercontent.com/FolioReader/FolioReaderKit/assets/header-doc.png" width="521px"/></p>
<h3 id='migration' class='heading'>Migration</h3>

<p>If you are migrating to a newer version check out <a href="/MIGRATION.md">MIGRATION</a> and <a href="/CHANGELOG.md">CHANGELOG</a>.</p>
<h2 id='author' class='heading'>Author</h2>

<p><a href="https://github.com/hebertialmeida"><strong>Heberti Almeida</strong></a></p>

<ul>
<li>Follow me on <strong>Twitter</strong>: <a href="https://twitter.com/hebertialmeida"><strong>@hebertialmeida</strong></a></li>
<li>Contact me on <strong>LinkedIn</strong>: <a href="http://linkedin.com/in/hebertialmeida"><strong>hebertialmeida</strong></a></li>
</ul>
<h2 id='license' class='heading'>License</h2>

<p>FolioReaderKit is available under the BSD license. See the <a href="/LICENSE">LICENSE</a> file.</p>

          </div>
        </section>


      </article>
    </div>
    <section class="footer">
      <p>&copy; 2019 <a class="link" href="https://twitter.com/hebertialmeida" target="_blank" rel="external">Heberti Almeida</a>. All rights reserved. (Last updated: 2019-02-21)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
